/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 30318
 * Date: 2023-11-28
 * Time: 16:09
 */
import java.util.Date;
public class Account {
    private String ID;
    private String name;
    private Date date;
    private int pw;
    private double balanced;

    public Account(String name) {
        this(name, 0);
    }

    public Account(String name, double balanced) {
        ID = "abcdefghijk123";
        pw = 123456;
        date = new Date();
        this. name = name;
        this.balanced = balanced;
    }

    public String getID(){
        return ID;
    }

    public String getName() {
        return name;
    }

    public Date getDate() {
        return date;
    }

    public int getPw() {
        return pw;
    }

    public double getBalanced() {
        return balanced;
    }

    public void setPw(int pw) {
        this.pw = pw;
    }

    public double withdraw(int number) {
        if(balanced>=number)
            balanced = number;
        return balanced;
    }

    public double savemoney(int number) {
        balanced += number;
        return balanced;
    }
}